/**
 * 
 */
package cn.ad.server.web.servlet.v2.parser;

/**
 * 参数解析异常
 * 该异常用于在解析某个具体参数出现异常的同时，并附带已经解析完成的结果一并抛出
 * @author Wu Chengjun
 */
public class ParameterParseExcption extends AdRequestParseException {
	
	/**
	 * 解析出现异常的参数名
	 */
	private String paramName;
	
	/**
	 * 实际读取到的参数值
	 */
	private String paramValue;
	
	/**
	 * 已经附加返回值
	 */
	private Object result;

	/**
	 * 
	 */
	public ParameterParseExcption() {
		
	}
	
	public ParameterParseExcption(String paramName, String paramValue) {
		this(paramName, paramValue, null);
	}

	/**
	 * 获取异常返回结果
	 * @return
	 */
	public Object getResult(){
		return result;
	}

	
	public ParameterParseExcption(String paramName, String paramValue, String message) {
		this(paramName, paramValue, message, null);
	}
	
	public ParameterParseExcption(String paramName, String paramValue, String message, Throwable cause) {
		super(message, cause);
		this.paramName = paramName;
		this.paramValue = paramValue;
	}

	/**
	 * @param message
	 */
	public ParameterParseExcption(String message) {
		super(message);
	}

	/**
	 * @param cause
	 */
	public ParameterParseExcption(Throwable cause) {
		super(cause);
	}

	/**
	 * @param message
	 * @param cause
	 */
	public ParameterParseExcption(String message, Throwable cause) {
		super(message, cause);
	}

	/**
	 * @param message
	 * @param cause
	 * @param enableSuppression
	 * @param writableStackTrace
	 */
	public ParameterParseExcption(String message, Throwable cause, boolean enableSuppression,
                                  boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}

	/**
	 * @return the paramName
	 */
	public String getParamName() {
		return paramName;
	}

	/**
	 * @return the paramValue
	 */
	public String getParamValue() {
		return paramValue;
	}

	/**
	 * @param result the result to set
	 */
	public void setResult(Object result) {
		this.result = result;
	}
}
